<%@ page import="com.bafa.objects.season.Season" %>
<%@ page import="com.bafa.objects.season.Division" %>
<%@ page import="com.bafa.objects.team.Team" %>
<%@ page import="com.bafa.objects.team.TeamSeasonStats" %>
<%@ page import="com.bafa.objects.team.TeamStats" %>
<%@ page import="com.bafa.objects.player.*" %>
<%@ page import="com.bafa.objects.*" %>
<%@ page import="com.bafa.middle.*" %>
<%@ page import="com.bafa.front.presentationbeans.*" %>
<%@ page import="java.util.*" %>
<% ResultsListBean results = (ResultsListBean)request.getAttribute("RESULTS");
%>
<% SeasonBean season = (SeasonBean)session.getAttribute("THISSEASON");%>
<% User user = (User)session.getAttribute("LOGGEDON"); %>
<%SiteBean siteBean = (SiteBean)session.getAttribute("SITEBEAN");%>
<script  src="script/niftycube.js" type="text/javascript" ></script>
	<script>
	NiftyLoad=function(){

		
		
Nifty("ul#results h3","top");
Nifty("ul#results div","bottom same-height");
	     


}


</script>
<style type="text/css">
	
	ul#results,ul#results li{margin:0;padding:0;list-style:none}
	ul#results li{float:left;width:485px;margin:0 10px 10px 0}
	ul#results h3{font: bold  Verdana,sans-serif;
	    text-transform:uppercase;margin:0px;padding: 5px 0 3px;text-align:center}
	ul#results p{margin:0;padding:5px 8px 15px}
	ul#results div{background:#FFFFFF}
	li#results div{border:2px solid #D2D2D2}
	
	
	
</style>


    <ul id="results"><li id="results"><h3 class="avlh">Results</h3>
    <div>         <table class="bafatablemedium"  border="0">

<%	for(int j=0;j<results.matches().length;j++){
	MatchBean match = results.matches()[j];
	String rowClass = "r1";
	if(j%2==0) rowClass="r2";
   %>
  <tr class="<%=rowClass%>">
                  <td><%=match.dayOfWeek()%> <%=match.day()%> <%=match.month()%></b></td>
                  <td><b><a href="team.bafa?TeamId=<%=match.getTeamA()%>&SeasonId=<%=season.getId()%>"><%=match.getTeamAName()%></a></b></td>
    		  <td><a href='viewmatchreport.bafa?matchId=<%=match.getID()%>'><%=match.getGoalsA()%> - <%=match.getGoalsB()%></a></td>
                  <td><b><a href="team.bafa?TeamId=<%=match.getTeamB()%>&SeasonId=<%=season.getId()%>"><%=match.getTeamBName()%></a> </b></td>
                  <td ><%if(ReportServices.doesReportExistForMatch(match.getID())){%><a href='viewmatchreport.bafa?matchId=<%=match.getID()%>'>See Report</a><%}else{%><span class="nlpblack"><%if(match.isPlayed()&&!match.isConfirmed()){%>Unconfirmed Result<%}else if(match.isWalkover()){%>Walkover<%}}%></span></td>
              </tr>
<tr class="<%=rowClass%>">
<td></td>
<td class="c2"> <%for(int u=0;u<match.getScorersA().players().length;u++){PlayerBean scorer = match.getScorersA().players()[u];%><a href="master?page=playerhistory&playername=<%=scorer.getName()%>"><%=scorer.getName()%></a>(<%=scorer.getGoals()%>)<br/><%}%></td>
<td></td>    
<td class="c2"> <%for(int u=0;u<match.getScorersB().players().length;u++){PlayerBean scorer = match.getScorersB().players()[u];%><a href="master?page=playerhistory&playername=<%=scorer.getName()%>"><%=scorer.getName()%></a>(<%=scorer.getGoals()%>)<br/><%}%></td>
<td></td>
</tr>

  <tr class="<%=rowClass%>">
    <%if(user!=null && user instanceof AdminUser){%>
        <td colspan="5"><a href='displayeditscorers.bafa?MatchId=<%=match.getID()%>&seasonId=<%=season.getId()%>'><b>Edit Scorers</b></a> | 
        	 <%if(match.isPlayed()&&!match.isConfirmed()){%><a href='confirmresult.bafa?MatchId=<%=match.getID()%>&seasonId=<%=season.getId()%>'><b>Confirm Result</b></a> | 
        	 <%}%>
        	 <a href="deletefixture.bafa?matchId=<%=match.getID()%>"><b>Delete</b></a>
        </td>
        <%}else{%>
        
    <%}%>
    
  </tr>
  
  
  <%}%>
</table>  </div>
</li>
</ul>